package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.core.domain.Region;
import cn.wolfcode.trip.core.query.RegionQueryObject;
import cn.wolfcode.trip.core.service.IRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 旅游地区资源控制器
 */
@RestController
@RequestMapping("regions")
public class RegionController {

    @Autowired
    private IRegionService regionService;

    /**
     * 获取旅游地区接口
     * 1.资源路径 /regions
     * 2.请求动作 get
     * 3.请求参数 RegionQuery
     * 4.返回结果 List<Region>
     */
    @GetMapping
    public List<Region> listAll(RegionQueryObject qo){

        return regionService.listAll(qo);
    }

}
